[build] Avoid archiving extracted library resources - #12447
[build] Avoid archiving extracted library resources#12447simonrozsival wants to merge 4 commits into
Conversation
Compile extracted Android library resources directly instead of duplicating them into res.zip archives. Avoid recursively clearing read-only attributes on non-Windows systems. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> Copilot-Session: 6469f820-c19a-4450-8bb9-de70387d899c
There was a problem hiding this comment.
Pull request overview
This PR optimizes the Android build pipeline by compiling extracted AAR and embedded-library resources directly from their resource directories, eliminating the intermediate res.zip archive step and related metadata so stale archives from older builds are not used.
Changes:
- Remove creation/consumption of per-library
res.zipresource archives and the associatedResourceDirectoryArchiveitem metadata. - Update
ResolveLibraryProjectImportsto stop generating archive paths and to only clear read-only attributes on Windows (avoiding expensive recursive scans on non-Windows). - Update AAPT2 compilation to compile resource directories directly (instead of optionally switching to a prebuilt zip archive).
Show a summary per file
| File | Description |
|---|---|
| src/Xamarin.Android.Build.Tasks/Xamarin.Android.EmbeddedResource.targets | Stops tracking archived resource outputs (ResourceDirectoryArchive) as FileWrites, aligning cleanup/up-to-date tracking with the no-archive flow. |
| src/Xamarin.Android.Build.Tasks/Tasks/ResolveLibraryProjectImports.cs | Removes res.zip generation/metadata and limits recursive “make writeable” directory scans to Windows only. |
| src/Xamarin.Android.Build.Tasks/Tasks/CollectNonEmptyDirectories.cs | Removes propagation of now-obsolete ResourceDirectoryArchive metadata from collected resource file items. |
| src/Xamarin.Android.Build.Tasks/Tasks/Aapt2Compile.cs | Removes logic that switches AAPT2 directory compilation to --zip based on ResourceDirectoryArchive, ensuring compilation uses resource directories directly. |
Review details
- Files reviewed: 4/4 changed files
- Comments generated: 0
- Review effort level: Lite
|
/review |
|
❌ Android PR Reviewer was cancelled. Please review the logs for details.
|
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
|
/review |
|
✅ Android PR Reviewer completed successfully!
|
There was a problem hiding this comment.
The resource-archive removal and Windows non-ASCII fallback look correct, and CI is green. I left one inline error-handling finding: temporary archive cleanup can mask the primary AAPT2 failure and stop cleaning subsequent files.
Generated by Android PR Reviewer for #12447 · gpt56 · 172.8 AIC · ⌖ 8.87 AIC · ⊞ 25.7K
Comment /review to run again
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Summary
res.ziparchives underobj/lpPerformance
In a clean MAUI Debug build,
ResolveLibraryProjectImportsfell from a median of about 5.8s to 3.3s. Compiling directories directly added only about 0.12s to AAPT2, for a net saving around 2.4s in this phase.Validation
Xamarin.Android.Build.Tasks.csprojres.zipfilesRelated: #10958